package com.common.jump;

import android.content.Context;
import android.os.Bundle;

import com.common.sp.UserSp;
import com.curry.android.util.IntentHelper;
import com.orangelife.mobile.constants.WebViewURL;
import com.orangelife.mobile.main.biz.JumpUtil;
import com.orangelife.mobile.web.WebActivity;

import java.util.HashMap;

/**
 * 跳转到网页界面
 * Created by wgf on 2016/7/18.
 */
public class WebJumper {

    public static void jumpToWebActivity(Context c, HashMap<String, Object> map) {
        jumpToWebActivity(c, 0, map);
    }

    public static void jumpToWebActivity(Context c, int id, HashMap<String, Object> map) {
        Bundle bundle = new Bundle();
        bundle.putInt("id", id);
        bundle.putBoolean("isBackForJs", true);
        bundle.putSerializable("map", map);
        IntentHelper.getInstances().bundleWithExtra(c, WebActivity.class, bundle);
    }

    /** 积分工坊 */
    public static void jumpToJifenGongFang(Context context) {
        JumpUtil.jumpActivityWithoutHost(context, WebViewURL.JIFEN_GONGFANG);
    }

    /** 签到 */
    public static void jumpToSignIn(Context context, boolean isFirstTime) {
        String time = "";
//        if (isFirstTime) {
//            time = "1";
//        }
        time = "2";/*v4.0.0关闭签到引导功能*/
        JumpUtil.jumpActivityWithoutHost(context, WebViewURL.SIGN_IN + UserSp.getAccessToken() + "&isonetime=" + time);
    }

    /** 社区活动订单详情 */
    public static void jumpToCommunityActivityOrderDetail(Context context, String orderID) {
        JumpUtil.jumpActivityWithoutHost(context, WebViewURL.COMMUNITY_ACTIVITY_ORDER_DETAIL + "?orderID=" + orderID + "&accessToken=" + UserSp.getAccessToken());
    }

    /** 社区活动订单列表 */
    public static void jumpToCommunityActivityOrderList(Context context) {
        JumpUtil.jumpActivityWithoutHost(context, WebViewURL.COMMUNITY_ACTIVITY_ORDER_LIST + "?accessToken=" + UserSp.getAccessToken());
    }

    /** 跳转到物业缴费钱包充值界面 */
    public static void jumpToPropertyWalletRecharge(Context context) {
        JumpUtil.jumpActivityWithoutHost(context, WebViewURL.PROPERTY_WALLET_RECHARGE);
    }

    /** 跳转到物业缴费钱包支付界面 */
    public static void jumpToPropertyWalletPay(Context context) {
        JumpUtil.jumpActivityWithoutHost(context, WebViewURL.PROPERTY_WALLET_PAY);
    }

    /** 跳转到物业缴费钱包详情界面 */
    public static void jumpToPropertyWalletDetail(Context context) {
        JumpUtil.jumpActivityWithoutHost(context, WebViewURL.PROPERTY_WALLET_DETAIL);
    }
}
